var win = Ti.UI.currentWindow;

Ti.include('background.js');
Ti.include('searchresults_tabs.js');

win.add(headerView);
win.add(viewContainer);

var viewTab = Ti.UI.createView({
	height: 45,
	width: 320,
	top: 0,
	left: 0
});
var viewTabPanel = Ti.UI.createView({
	bottom: 0,
	top: 45//,
	//backgroundColor: '#ff0'
});

viewContainer.add(viewTab);
viewContainer.add(viewTabPanel);

viewTab.add(resultsTab);
viewTab.add(mapTab);

viewTabPanel.add(resultsPanel);
viewTabPanel.add(mapPanel);

var searchResults = {type:'region', usergroups:[]};
if (Ti.App.Properties.getString('ug_search')) {
	searchResults = JSON.parse(Ti.App.Properties.getString('ug_search'));
}

ShowResults();

Ti.include('searchresults_list.js');
Ti.include('searchresults_map.js');
